#ifndef _GDU_FWUP_H_
#define _GDU_FWUP_H_

#define PKG_SIGNATURE	0xCAFE0114

extern void fwup_handle_upd_req(UDP_DAEMON_* ud);
extern void fwup_handle_upd_ack(UDP_DAEMON_* ud);
extern void fwup_handle_upd_result(UDP_DAEMON_* ud);
extern void fwup_handle_sync_req(UDP_DAEMON_* ud);
extern void fwup_handle_sync_result(UDP_DAEMON_* ud);
extern void fwup_handle_ver_req(UDP_DAEMON_* ud);
extern void fwup_handle_ver_resp(UDP_DAEMON_* ud);
extern void fwup_handle_load_status(UDP_DAEMON_* ud);
extern void fwup_issue_upd_ack(UDP_DAEMON_* ud, unsigned short result);
extern void fwup_issue_upd_result(UDP_DAEMON_* ud, unsigned short result);
extern void fwup_issue_sync_req(UDP_DAEMON_* ud);
extern void fwup_issue_sync_ack(UDP_DAEMON_* ud, unsigned short result);
extern void fwup_issue_sync_result(UDP_DAEMON_* ud, unsigned short result);
extern void fwup_issue_ver_req(UDP_DAEMON_* ud);
extern void fwup_issue_ver_resp(UDP_DAEMON_* ud, unsigned short result);
extern void fwup_issue_dl_status(UDP_DAEMON_* ud, int state,
		unsigned short result);
extern void fwup_to_state(UDP_DAEMON_* ud, int state, int reason);
extern void fwup_do_state(UDP_DAEMON_* ud);
extern void fwup_show_version(void);
extern int fwup_parse_version(pkginfo_t* pkg);
extern int fwup_parse_gunzip(UDP_DAEMON_* ud, char* buf, int* reason);
extern int fwup_parse_tftp(UDP_DAEMON_* ud, char* buf, int* reason);
extern int fwup_parse_tar(UDP_DAEMON_* ud, char* buf, int* reason);
extern int fwup_parse_head(UDP_DAEMON_* ud, char* buf, int* reason);
extern int fwup_parse_tail(UDP_DAEMON_* ud, char* buf, int* reason);
extern int fwup_parse_tag(UDP_DAEMON_* ud, int* reason);
extern int fwup_parse_sync(UDP_DAEMON_* ud, char* buf, int* reason);
extern int fwup_parse_diff_before(UDP_DAEMON_* ud, char* buf);
extern int fwup_parse_diff_after(UDP_DAEMON_* ud, char* buf, int* reason);
extern void fwup_debug_tftp_start(void);
extern void fwup_debug_version_request(void);
extern void fwup_debug_fwdownload_start(void);
extern void fwup_debug_sync_request(void);

extern void fwup_to_fork(UDP_DAEMON_* ud, int state, int reason);
extern void fwup_do_fork(UDP_DAEMON_* ud, int state, int reason);
extern void fwup_fork_init(void);

extern void fwup_make_file(char* path_and_name);

#endif

